package org.example.design.observer.test2;

/**
 * @author huangshen
 * @version 0
 * @description 十六进制输出类
 * @since 2022/2/11 14:28
 */
public class HexObserver extends Observer{

    public HexObserver(Subject subject){
        this.subject = subject;
        this.subject.attach(this);
    }

    @Override
    public void update() {
        System.out.println( "十六进制 String: "
                + Integer.toHexString( subject.getState() ).toUpperCase() );
    }
}
